


***** REPLICATION CODE FOR BOWLER AND INDRIDASON "Determinants of cabinet size," European Journal of Political Research, Volume 53, Issue 2
***** There are four data files: i) Size of initial cabinet including all ministers: cabinet_size_replication_data
*****                           ii) Average size of cabinet including all ministers: cabinet_size_replication_data_average
*****                          iii) Size of initial cabinet excluding ministers w/o portfolios: cabinet_size_replication_data_no_MWOP
*****                           iv) Size of initial cabinet excluding non-partisan ministers: cabinet_size_replication_data_no_nonpartisans

*** Load data
	use "cabinet_size_replication_data.dta", clear

*** Table 1. Summary statistics

	quietly reg noministers  nocabparties cabseats minorcab  surplus sizeleg sizesq ideoldistcab year social conserv popint eu fed,  vce(cluster countries)
	gen insample=e(sample)
	sum noministers  nocabparties cabseats minorcab  surplus sizeleg sizesq ideoldistcab social conserv popint eu fed if insample

*** Figure 1. Size of cabinets by country and year.

	gen y=year+1944
	sort country

	* By country and year
	scatter nomin y if initial==1 & insample==1 & country~="GRC", by(country, note("")) scheme(s1mono) xtitle("Year") ytitle("Number of Ministers")

*** Figure 2. Legislature size versus cabinet size. 

	reg nomin sizeleg sizesq if initial==1 & insample==1
	predict prnomin, xb
	gen sizeab=sizeleg*100
	sort sizeleg
	line prnomin sizele, color(dkorange) lwidth(thick) || ///
		scatter noministers sizele if initial==1 & insample==1, ///
		scheme(s1mono) xtitle("{stSerif:Size of Legislature}") ytitle("Number of Ministers") legend(off) mcolor(gray) msymbol(circle)


*** Figure 3. Size of cabinets by country and legislature size
	* By size of legislature
	* Countries where size of legislature has changed
	gen sizeleg100=sizeleg*100
	scatter nomin sizeleg100 if initial==1 & insample==1 & (country=="DEU" | ///
		country=="DNK" | ///
		country=="FRA" | ///
		country=="IRL" | ///
		country=="ITA" | ///
		country=="NLD" | ///
		country=="NOR" | ///
		country=="SWE" ), ///
		by(country, note("")) scheme(s1mono) xtitle("Size of Legislature") ytitle("Number of Ministers")



*** Table 2. Determinants of cabinet size

	*re-tsset, sorting for graphs trips Stata up
	tsset countries ncabid

	reg noministers  nocabparties cabseats minorcab  surplus sizeleg sizesq ideoldistcab year social conserv popint eu fed,  vce(cluster countries)

	reg noministers l.nomin nocabparties cabseats sizeleg sizesq minorcab surplus ideoldistcab year social conserv popint eu fed, vce(cluster countries)

	xtreg noministers l.nomin nocabparties cabseats sizeleg sizesq minorcab  surplus ideoldistcab year social conserv popint eu fed, fe vce(cluster countries)
	
	
*** Figure 4. Marginal effect of legislature size. 
	
	reg noministers l.nomin nocabparties cabseats c.sizeleg##c.sizeleg minorcab surplus ideoldistcab year social conserv popint eu fed, vce(cluster countries)
	margins, dydx(sizeleg) at(sizeleg=(.5(.5)6.5))  post

	**** J(x,y,.) creates a 'constant' matrix every value here is `.' with x rows and y columns
	matrix t = J(13,3,.)
	**** Creates a 13 by 1 matrix -> `\' indicates end of row, `,' would separate columns
	matrix ppr=(50\100\150\200\250\300\350\400\450\500\550\600\650)

	**** Cycle through the 13 estimate from the margin command
	forvalues i=1/13 {
		**** lincom calculates linear combinations of estimates in memory
		**** Here: just used to access the marginal effect and s.e. -> `i' 
		quietly lincom _b[sizeleg:`i'._at]
		*** Insert the marginal effect in to row `i', column 1
		matrix t[`i',1] = r(estimate)
		*** Insert the lower bound for the confidence interval of the marginal effect in to row `i', column 1
		matrix t[`i',2] = r(estimate) - 1.96*r(se)
		matrix t[`i',3] = r(estimate) + 1.96*r(se) 
		}

	**** Attach the matrices t and ppr	
	matrix t = t,ppr
	**** Dump matrix into dataset
	svmat t
	**** Graph marginal effect
	graph twoway ///
	(line t2 t4,  lcolor(gs13) lpattern(dash)) ///
	(line t3 t4,  lcolor(gs13) lpattern(dash)) ///
	(line t1 t4 ),  legend(off) ///
	xtitle(Legislature Size) ///
	ytitle(Marginal Effect of Legislatie Size) ///
	scheme(s1mono) xlabel(50(100)650) ylabel(-1(.5)2.5) yline(0 .5 1 1.5 2 -.5, lcolor(gs13) lwidth(vthin) lstyle(refline)) ///
	yline(0, lcolor(gray) lwidth(vthin) lstyle(refline)) ///
	name(difference`i', replace)

	
*****************************************************************************
*****************************************************************************	
******* RESULTS IN ONLINE APPENDIX
*****************************************************************************
*****************************************************************************

*** Table 1 (appendix): Dependent variable: Average Size of Cabinet

	use "cabinet_size_replication_data_average.dta", clear

	reg noministers  nocabparties cabseats minorcab  surplus sizeleg sizesq ideoldistcab year social conserv popint eu fed,  vce(cluster countries)

	reg noministers l.nomin nocabparties cabseats sizeleg sizesq minorcab surplus ideoldistcab year social conserv popint eu fed, vce(cluster countries)

	xtreg noministers l.nomin nocabparties cabseats sizeleg sizesq minorcab  surplus ideoldistcab year social conserv popint eu, fe vce(cluster countries)


*** Table 2 (appendix): Dependent Variable: Initial Size of Cabinet, Controlling for Semi-Presidentialism

	use "cabinet_size_replication_data.dta", clear

	reg noministers  nocabparties cabseats minorcab  surplus sizeleg sizesq ideoldistcab year social conserv popint eu fed semi,  vce(cluster countries)

	reg noministers l.nomin nocabparties cabseats sizeleg sizesq minorcab surplus ideoldistcab year social conserv popint eu fed semi, vce(cluster countries)

	xtreg noministers l.nomin nocabparties cabseats sizeleg sizesq minorcab  surplus ideoldistcab year social conserv popint eu, fe vce(cluster countries)

*** Table 3 (appendix): Dependent Variable: Initial Size of Cabinet, Excludes Ministers w/o Portfolio

	use "cabinet_size_replication_data_no_MWOP.dta", clear
	
	reg noministers  nocabparties cabseats minorcab  surplus sizeleg sizesq ideoldistcab year social conserv popint eu fed,  vce(cluster countries)

	reg noministers l.nomin nocabparties cabseats sizeleg sizesq minorcab surplus ideoldistcab year social conserv popint eu fed, vce(cluster countries)

	xtreg noministers l.nomin nocabparties cabseats sizeleg sizesq minorcab  surplus ideoldistcab year social conserv popint eu, fe vce(cluster countries)

	
*** Table 4 (appendix): Dependent Variable: Initial Size of Cabinet, Excludes Non-Partisan Ministers
	
	use "cabinet_size_replication_data_no_nonpartisans.dta", clear

	reg noministers  nocabparties cabseats minorcab  surplus sizeleg sizesq ideoldistcab year social conserv popint eu fed,  vce(cluster countries)

	reg noministers l.nomin nocabparties cabseats sizeleg sizesq minorcab surplus ideoldistcab year social conserv popint eu fed, vce(cluster countries)

	xtreg noministers l.nomin nocabparties cabseats sizeleg sizesq minorcab  surplus ideoldistcab year social conserv popint eu fed, fe vce(cluster countries)